<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="Keywords" content="区域低碳,低碳产业,低碳城市,存量收购,增量投资">
    <meta name="Description" content="碳银网-低碳产业平台资源集成商，推动区域低碳、低碳城市发展，促进低碳产业产融结合，收购存量资产、增量投资。">
    <meta name="csrf-token" content="{{csrf_token()}}">
    <title>碳银网-登录</title>
    <link rel="stylesheet" href="{{env('SOURCE_PATH')}}css/v3_base.css">
    <link rel="stylesheet" href="{{env('SOURCE_PATH')}}css/v3_style.css">
</head>
<body>

<div class="v3-site_nav">
    <div class="v3-contain">
        <div class="fl">
            <span class="tip">欢迎来到碳银平台！</span>
            {{-- <a href="#" target="_parent" class="login">登录</a>
            <a href="#" target="_parent">注册</a> --}}
        </div>
        <div class="fr">
            {{-- <a href="#" target="_parent"><span>我的碳银</span></a> --}}
            <span class="tel">商务合作：0571-83530366</span>
        </div>
    </div>
</div>
<div class="v3-head">
    <div class="v3-contain">
        <div class="fl">
            <h1 class="logo">
                <a href="/" target="_parent"><img src="{{env('SOURCE_PATH')}}img/logo.png" height="61" alt="碳银网"></a>
            </h1>
        </div>
    </div>
</div>
<div class="login-bg">
    <div class="v3-contain" style="margin-top:35px;">
        <div class="login-form">
            <div class="pop-login">
                <div id="loginTit" class="title"><span>欢迎登录</span></div>
                <div class="form">
                    <div class="row">
                        <div class="icon icon-user"></div>
                        <input id="username" type="text" class="ipt" maxlength="11" placeholder="请输入手机号">
                    </div>
                    <div class="row">
                        <div class="icon icon-pass"></div>
                        <input id="password" type="password" class="ipt" placeholder="请输入密码">
                    </div>
                    <!-- <div class="row">
                        <input class="ipt ipt_code" id="code" type="text" placeholder="请输入验证码" maxlength="5" name="captcha">
                        <img src="/captcha/login" alt="captcha" class="imgcode j_changeCode">
                    </div> -->
                    <div class="row">
                        <div class="forget">
                            <a class="fr" href="/regist">立即注册</a>
                            <a href="/forget_pwd">忘记密码？</a>
                        </div>
                    </div>
                    <div class="row">
                        <a id="submit" class="btn btn-login">登录</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{{-- <input type="hidden" id="client_id" name="client_id" value="{{$client_id}}">
<input type="hidden" id="redirect_uri" name="redirect_uri" value="{{$redirect_uri}}">
<input type="hidden" id="scope" name="scope" value="{{$scope}}">
<input type="hidden" id="state" name="state" value="{{$state}}">
<input type="hidden" id="response_type" name="response_type" value="{{$response_type}}">
 --}}<div class="v3-foot">
    <div class="v3-contain">
        <div class="title">友情链接</div>
        <div class="links">
            <a class="nobefore" href="http://www.gov.cn/guowuyuan/" target="_blank" rel="nofollow">国务院</a>
            <a href="http://www.sdpc.gov.cn" target="_blank" rel="nofollow">发改委</a>
            <a href="http://www.miit.gov.cn" target="_blank" rel="nofollow">工信部</a>
            <a href="http://www.mep.gov.cn" target="_blank" rel="nofollow">环保部</a>
            <a href="http://www.most.gov.cn/" target="_blank" rel="nofollow">科技部</a>
            <a href="http://www.mof.gov.cn/index.htm" target="_blank" rel="nofollow">财政部</a>
            <a href="http://www.people.com.cn/" target="_blank" rel="nofollow">人民网</a>
            <a href="http://www.xinhuanet.com/" target="_blank" rel="nofollow">新华网</a>
            <a href="http://www.cctv.com/" target="_blank" rel="nofollow">央视网</a>
            <a href="http://www.chinanews.com/" target="_blank" rel="nofollow">中国新闻网</a>
        </div>
        <div class="partner">
            <a href="http://www.zdherun.com/" target="_blank" rel="nofollow">泽大合润</a>
            <a href="http://www.chinacoal.com/" target="_blank" rel="nofollow">中煤能源</a>
            <a href="http://www.jhgf.com.cn/" target="_blank" rel="nofollow">巨化集团</a>
            <a href="http://www.gcl-power.com" target="_blank" rel="nofollow">协鑫集团</a>
            <a href="http://www.shanghai-electric.com/Pages/Index.aspx" target="_blank" rel="nofollow">上海电气</a>
            <a href="http://www.cecic.com.cn" target="_blank" rel="nofollow">中国节能</a>
            <a href="http://www.cgnpc.com.cn" target="_blank" rel="nofollow">中广核集团</a>
            <a href="http://www.himin.com" target="_blank" rel="nofollow">皇明太阳能</a>
            <a href="http://www.linuo.com" target="_blank" rel="nofollow">力诺集团</a>
            <a href="http://www.united-water.com" target="_blank" rel="nofollow">联合水务</a>
        </div>
        <div class="copy">
            Copyright <span>&copy;</span> 2015 TanWin All Rights Reserved 浙ICP备15025931号-2
        </div>
    </div>
</div>


<script src="{{env('SOURCE_PATH')}}libs/jquery.min.js"></script>
<script src="{{env('SOURCE_PATH')}}js/common.js"></script>

<script>
    (function ($) {
        $(function () {

//获取uil参数
function GetQueryString(name)
{
     var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
     var r = window.location.search.substr(1).match(reg);
     if(r!=null)return  unescape(r[2]); return null;
}

            //刷新验证码
            $(".j_changeCode").on("click", function () {
                var $t = $(this);
                $t.attr("src", "/captcha/login?" + new Date().getTime());
            });

            //提交
            $("#submit").click(function () {
                var $t = $(this);
                if($t.attr("class").indexOf("disable") === -1) {
                    var $phone = $("#username");
                    var phone = $phone.val();
                    if (!isPhone(phone)) {
                        return showErr($phone, "请输入正确的手机号码！");
                    }
                    var $pwd = $("#password");
                    var pwd = $pwd.val();
                    if (!pwd) {
                        return showErr($phone, "请输入密码！");
                    }
                    var $code = $("#code");
                    var vcode = "";
                    if ($code && $code.length > 0) {
                        vcode = $code.val();
                        if (!vcode) {
                            return showErr($phone, "请输入验证码！");
                        }
                    }
                    var client_id = GetQueryString('client_id');
                    var state = GetQueryString('state');
                    var scope = GetQueryString('scope');
                    var response_type = GetQueryString('response_type');
                    var redirect_uri = GetQueryString('redirect_uri');
                    $.ajax({
                        url: "/oauth_login",
                        headers: {
                            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                        },
                        data: {
                            phone: phone,
                            //captcha: vcode,
                            pwd: pwd,
                            client_id:client_id,
                            state:state,
                            scope:scope,
                            response_type:response_type,
                            redirect_uri:redirect_uri
                        },
                        type: "POST",
                        dataType: "json",
                        success: function (data) {
                            var result = data["result"];
                            var msg = data["msg"];
                            var token = data["token"];
                            var j_url = data["url"];
                            var limit = data["login_error_limit"];
                            if (limit) {
                                location.reload();
                            }
                            if (result === 0) {
                                //j_login(phone,token,j_url);
                                window.location.href=data["redirect_url"];
                                return false;
                            } else {
                                //$(".j_changeCode").attr("src", "/captcha/login?" + new Date().getTime());
                                return showErr($t, msg);
                            }
                        },
                        error: function (data) {
                            return showErr($t, "登录失败！");
                        }
                    });
                }
            });

            //回车键提交
            $(document).on("keydown", function (event) {
                var e = event || window.event || arguments.callee.caller.arguments[0];
                if (e && e.keyCode == 13) {
                    $("#submit").click();
                }
            });
        });
    })(jQuery);
</script>
</body>
</html>
